def archives_filter(query_set, filter, value):
    if filter == 'month':
        query_set = query_set.filter(pub_date__month=value)
    elif filter == 'year':
        query_set = query_set.filter(pub_date__year=value)
    elif filter == 'issue':
        query_set = query_set.filter(issues=value)
    elif filter == 'rep':
        query_set = query_set.filter(reps=value)
    return query_set

